package com.bcu.calculus.controller;

import com.bcu.calculus.entity.CheckMessage;
import com.bcu.calculus.entity.CheckMessageNumber;
import com.bcu.calculus.entity.CheckType;
import com.bcu.calculus.entity.Message;
import com.bcu.calculus.service.CheckMessageService;
import com.bcu.calculus.service.CheckTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.text.ParseException;
import java.util.List;

@Api(tags = "19  考勤人员信息模块")
@RestController
@RequestMapping("/api/CheckMessage")
public class CheckMessageController {

    @Resource
    private CheckMessageService checkMessageService;

    @ApiOperation(value = "增加")
    @PostMapping(value = "/insertSelective")
    public Message<?> insertSelective(CheckMessageNumber checkMessageNumber) throws ParseException {
        return checkMessageService.insertSelective(checkMessageNumber);
    }


    @ApiOperation(value = "删除")
    @PostMapping(value = "/deleteByPrimaryKey")
    public Message<?> deleteByPrimaryKey(String checkMessageId) {
        return checkMessageService.deleteByPrimaryKey(checkMessageId);
    }


    @ApiOperation(value = "修改")
    @PutMapping(value = "/updateByPrimaryKeySelective")
    public Message updateByPrimaryKeySelective(CheckMessageNumber checkMessageNumber) throws ParseException {
        return checkMessageService.updateByPrimaryKeySelective(checkMessageNumber);
    }


    @ApiOperation(value = "查所有")
    @GetMapping(value = "/selectAll")
    public Message<List<CheckMessage>> selectAll(){
        return checkMessageService.selectAll();
    }


    @ApiOperation(value = "关键字查询")
    @GetMapping(value = "/selectById")
    public Message<List<CheckMessage>> selectById(String checkMessageId){
        return checkMessageService.selectById(checkMessageId);
    }

    @ApiOperation(value = "根据所属考情编号")
    @GetMapping(value = "/selectBy")
    public Message<List<CheckMessage>> selectByAttendanceId(String checkAttendanceId){
        return checkMessageService.selectByAttendanceId(checkAttendanceId);
    }
}
